package com.mvc.util;

import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
import java.util.List;

public class FileUtil {
	
	private static List<String> fileList = new ArrayList<String>();
	
	public static List<String> getAllActionFiles(String path, FileFilter filter){
		File file = new File(path);
		File[] files = file.listFiles(filter);
		if(files == null){
			return null;
		}else{
			for(File f : files){
				if(f.isDirectory()){
					getAllActionFiles(f.getAbsolutePath(), filter);
				}else{
					fileList.add(f.getAbsolutePath());
//					System.out.println(f.getAbsolutePath());
				}
			}
		}
		
		return fileList;
	}
}
